package com.netty.protocoltcp;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

public class My_ClientInitiazer1 extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();
        //增加入站的编码器
        pipeline.addLast(new MyMessageEncoder());
        //增加出站的解码器
        pipeline.addLast(new MyMessageDecoder());
        pipeline.addLast(new My_ClientHander());
    }
}
